package com.xbongbong.saas.enums;

import com.xbongbong.paas.enums.PlatFormEnum;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/3/28 10:13
 * @since v1.0
 */
@Getter
public enum PaasDetailTabEnum {

    /**
     * paas的tab
     */
    BASE_DETAIL( DetailTabEnum.BASE_DETAIL_TAB, PlatFormEnum.ALL),
    /**
     * paas团队
     */
    PAAS_TEAM(DetailTabEnum.SALE_TEAM, PlatFormEnum.WEB),

    /**
     * 文件柜
     */
    FILE_CABINET(DetailTabEnum.FILE_CABINET, PlatFormEnum.ALL),
    STAGE_HISTORY(DetailTabEnum.STAGE_HISTORY, PlatFormEnum.ALL),
    APPROVAL_RECORDS(DetailTabEnum.APPROVAL_RECORDS, PlatFormEnum.WEB),
    APPROVAL_PROCESS(DetailTabEnum.APPROVAL_PROCESS, PlatFormEnum.DINGTALK),
    APPROVAL_HISTORY(DetailTabEnum.APPROVAL_HISTORY, PlatFormEnum.DINGTALK),

    ;

    private DetailTabEnum anEnum;
    private PlatFormEnum platform;

    PaasDetailTabEnum(DetailTabEnum anEnum, PlatFormEnum platform) {
        this.anEnum = anEnum;
        this.platform = platform;
    }

    public static List<PaasDetailTabEnum> getWebTabList(){
        List<PaasDetailTabEnum> tabList = new ArrayList<>();
        for (PaasDetailTabEnum value : PaasDetailTabEnum.values()) {
            if(Objects.equals(value.getPlatform(), PlatFormEnum.WEB) || Objects.equals(value.getPlatform(), PlatFormEnum.ALL)){
                tabList.add(value);
            }
        }
        return tabList;
    }

}
